




#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "yaxiswindow.h"
#endif

#include <wx/wxprec.h>

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif

#include "wx/yaxiswindow.h"
#include "wx/chartsizes.h"

IMPLEMENT_DYNAMIC_CLASS(wxYAxisWindow, wxWindow)

BEGIN_EVENT_TABLE(wxYAxisWindow, wxWindow)
  EVT_PAINT(        wxYAxisWindow::OnPaint)
  EVT_LEFT_DOWN(    wxYAxisWindow::OnMouse)
  EVT_LEFT_DCLICK(  wxYAxisWindow::OnMouse)
END_EVENT_TABLE()




wxYAxisWindow::wxYAxisWindow(
	 wxScrolledWindow *parent,
	 ChartValue max,
	 ChartValue min
):  wxWindow(parent, -1, wxDefaultPosition,
			 wxSize(YAXIS_WIDTH, YAXIS_HEIGHT)),
	m_WinParent(parent),
	m_YAxis(max, min) {
	SetBackgroundColour( *wxWHITE );
}


void wxYAxisWindow::SetVirtualMax(
	ChartValue v
) {
	m_YAxis.SetVirtualMax( v );
}


void wxYAxisWindow::SetVirtualMin(
	ChartValue v
) {
	m_YAxis.SetVirtualMin( v );
}


//----------------------------------------------------------------------E-+++
ChartValue wxYAxisWindow::GetVirtualMax() const {
	return ( m_YAxis.GetVirtualMax() );
}


//----------------------------------------------------------------------E-+++
ChartValue wxYAxisWindow::GetVirtualMin() const {
	return ( m_YAxis.GetVirtualMin() );
}


void wxYAxisWindow::SetZoom(
	double z
) {
	m_YAxis.SetZoom( z );
}


//----------------------------------------------------------------------E-+++
double wxYAxisWindow::GetZoom() {
	return ( m_YAxis.GetZoom() );
}


void wxYAxisWindow::SetSizes(
	wxChartSizes *sizes
) {
	m_YAxis.SetSizes( sizes );
}


const wxChartSizes* wxYAxisWindow::GetSizes() const {
	return ( m_YAxis.GetSizes() );
}



void wxYAxisWindow::Draw(
	CHART_HPAINT hp,
	int x,
	int y
) {



	CHART_RECT r;
    r.x = x; r.y = y;
	r.xscroll = 0; r.yscroll = 0;
	GetClientSize( &r.w, &r.h );




	m_YAxis.Draw( hp, &r );
}


void wxYAxisWindow::OnPaint(
	wxPaintEvent &WXUNUSED(event)
) {
    wxPaintDC dc( this );




	Draw( &dc );
}


void wxYAxisWindow::OnMouse(
	wxMouseEvent &WXUNUSED(event)
) {
}
